
import 'package:flutter/material.dart';

class RecommendItem extends StatelessWidget {
  const RecommendItem({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: (){
        print("发生了点击");
      },
      child: Card(
        child: PhysicalModel(
          color: Colors.transparent,
          clipBehavior: Clip.antiAlias,
          borderRadius: BorderRadius.circular(5),
          child: Column(
            children: [
              _itemImage(context),
              Container(
                padding: EdgeInsets.all(4),
                child: Text("美女",
                  maxLines: 2,
                  overflow: TextOverflow.ellipsis,
                  style: TextStyle(fontSize: 14,color: Colors.black87),
                ),
              ),
              _infoText(),
            ],
          ),
        ),
      ),
    );
  }

  _itemImage(BuildContext context) {
    return Image.network("https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=233301930,3031623456&fm=11&gp=0.jpg");
  }

  _infoText() {
    return Container(
      padding: EdgeInsets.fromLTRB(6,8,6,10),
      child: Column(
        children: [
          Padding(
              padding: EdgeInsets.only(bottom: 5),
              child: Text(
                "这是鞠婧祎超级好看的美女",
                style: TextStyle(
                  fontSize: 11,
                  color: Colors.deepOrangeAccent
                ),
              ),
          ),
          Row(
            children: [
              Text("金钱符号",
                style: TextStyle(fontSize: 10,color: Colors.redAccent),
              ),
              Padding(
                  padding: EdgeInsets.only(right: 5),
                  child: Text(
                    "123234234234234234234234",
                    style: TextStyle(fontSize: 18,color: Colors.redAccent),
                  ),
              ),
              Text(
                "这是数量",
                style: TextStyle(fontSize: 12,color: Colors.grey),
              )
            ],
          ),
        ],
      ),
    );
  }
}
